<?php

/**
 * Trida entity pro moduly.
 *
 * @author David Dusek
 */
namespace CMS\Module\Models;

use Doctrine\ORM\Mapping as ORM;

/** 
 * @ORM\Entity(repositoryClass="\CMS\Module\Models\ModuleRepository")
 * @ORM\Table(name="module")
 */
class Module extends \Nette\Object {
    /**
     * @ORM\Id
     * @ORM\Column(name="module_name", type="string", length=50)
     * @var string 
     */
    private $name;
    
    /**
     * @ORM\Column(type="boolean")
     * @var boolean 
     */
    private $active;
    
    /**
     * @ORM\Column(type="string", length=20)
     * @var String 
     */
    private $version;
    
    /**
     * @ORM\Column(type="string", length=100)
     * @var String 
     */
    private $author;
    
    /**
     * @ORM\Column(name="`order`", type="smallint")
     * @var Integer
     */
    private $order = 0;
    
    /**
     * @ORM\Column(type="boolean")
     * @var boolean
     */
    private $system = 0;
    
    public function setName($name) {
        $this->name = $name;
    }
    
    public function getName() {
        return $this->name;
    }

    public function setActive($active) {
        if ($this->system) {
            $active = TRUE; 
        }
        
        $this->active = $active; 
    }

    public function getActive() {
        return $this->active;
    }
    
    public function setVersion($version) {
        $this->version = $version; 
    }

    public function getVersion() {
        return $this->version;
    }

    public function setAuthor($author) {
        $this->author = $author; 
    }

    public function getAuthor() {
        return $this->author;
    }
    
    public function setOrder($order) {
        $this->order = $order; 
    }

    public function getOrder() {
        return $this->order;
    }

    public function setSystem($system) {
        $this->system = $system; 
    }

    public function getSystem() {
        return $this->system;
    }

}
